CREATE TABLE `SRAnalytics`.`MsgOptionPrintSet` (
`okey_at` ENUM('None','EQT','IDX','BND','CUR','COM','FUT','SYN','WAR','FLX','MUT','SPD','MM','MF','COIN','TOKEN','ANY') NOT NULL DEFAULT 'None',
`okey_ts` ENUM('None','SR','NMS','CME','ICE','CFE','CBOT','NYMEX','COMEX','RUT','CIDX','ARCA','NYSE','OTC','NSDQ','MFQS','MIAX','DJI','CUSIP','ISIN','BXE','EUX','ANY','CXE','DXE','NXAM','NXBR','NXLS','NXML','NXOS','NXP','EUREX','CEDX','ICEFE') NOT NULL DEFAULT 'None',
`okey_tk` VARCHAR(12) NOT NULL DEFAULT '',
`okey_yr` SMALLINT UNSIGNED NOT NULL DEFAULT 0,
`okey_mn` TINYINT UNSIGNED NOT NULL DEFAULT 0,
`okey_dy` TINYINT UNSIGNED NOT NULL DEFAULT 0,
`okey_xx` DOUBLE NOT NULL DEFAULT 0,
`okey_cp` ENUM('Call','Put','Pair') NOT NULL DEFAULT 'Call',
`prtNumber` BIGINT NOT NULL DEFAULT 0 COMMENT 'Unique print set identifier, will increment but not guaranteed to be sequential',
`updateType` ENUM('None','Print','Markup') NOT NULL DEFAULT 'None',
`fkey_at` ENUM('None','EQT','IDX','BND','CUR','COM','FUT','SYN','WAR','FLX','MUT','SPD','MM','MF','COIN','TOKEN','ANY') NOT NULL DEFAULT 'None' COMMENT 'underlying fkey (if any)',
`fkey_ts` ENUM('None','SR','NMS','CME','ICE','CFE','CBOT','NYMEX','COMEX','RUT','CIDX','ARCA','NYSE','OTC','NSDQ','MFQS','MIAX','DJI','CUSIP','ISIN','BXE','EUX','ANY','CXE','DXE','NXAM','NXBR','NXLS','NXML','NXOS','NXP','EUREX','CEDX','ICEFE') NOT NULL DEFAULT 'None' COMMENT 'underlying fkey (if any)',
`fkey_tk` VARCHAR(12) NOT NULL DEFAULT '' COMMENT 'underlying fkey (if any)',
`fkey_yr` SMALLINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'underlying fkey (if any)',
`fkey_mn` TINYINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'underlying fkey (if any)',
`fkey_dy` TINYINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'underlying fkey (if any)',
`ticker_at` ENUM('None','EQT','IDX','BND','CUR','COM','FUT','SYN','WAR','FLX','MUT','SPD','MM','MF','COIN','TOKEN','ANY') NOT NULL DEFAULT 'None' COMMENT 'underlying ticker',
`ticker_ts` ENUM('None','SR','NMS','CME','ICE','CFE','CBOT','NYMEX','COMEX','RUT','CIDX','ARCA','NYSE','OTC','NSDQ','MFQS','MIAX','DJI','CUSIP','ISIN','BXE','EUX','ANY','CXE','DXE','NXAM','NXBR','NXLS','NXML','NXOS','NXP','EUREX','CEDX','ICEFE') NOT NULL DEFAULT 'None' COMMENT 'underlying ticker',
`ticker_tk` VARCHAR(12) NOT NULL DEFAULT '' COMMENT 'underlying ticker',
`prtExch` ENUM('None','AMEX','BOX','CBOE','ISE','NYSE','PHLX','NSDQ','BATS','C2','NQBX','MIAX','GMNI','CME','CBOT','NYMEX','COMEX','ICE','EDGO','MCRY','MPRL','SDRK','DQTE','EMLD','CFE','MEMX','SPHR','EUREX','CEDX','NXAM','NXBR','NXLS','NXML','NXOS','NXP','ICEFE') NOT NULL DEFAULT 'None' COMMENT 'exchange on which print took place',
`prtSize` INT NOT NULL DEFAULT 0 COMMENT 'print size [contracts]',
`prtPrice` FLOAT NOT NULL DEFAULT 0 COMMENT 'print price',
`prtType` ENUM('None','CANC','OSEQ','CNCL','LATE','CNCO','OPEN','CNOL','OPNL','AUTO','REOP','ISOI','SLAN','SLAI','SLCN','SCLI','SLFT','MLET','MLAT','MLCT','MLFT','MESL','TLAT','MASL','MFSL','TLET','TLCT','TLFT','TESL','TASL','TFSL','CBMO','MCTP','EXHT') NOT NULL DEFAULT 'None' COMMENT 'print type',
`prtOrders` SMALLINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'number of participating orders (future exchanges only)',
`prtClusterNum` INT NOT NULL DEFAULT 0 COMMENT 'incremental print cluster counter (one counter per okey; used to group prints into clusters)',
`prtClusterSize` INT NOT NULL DEFAULT 0 COMMENT 'cumulative size of prints in this sequence (prints @ same or more aggressive price with less than 25 ms elapsing since first print; can span exchanges)',
`prtVolume` INT NOT NULL DEFAULT 0 COMMENT 'day print volume in contracts',
`cxlVolume` INT NOT NULL DEFAULT 0 COMMENT 'day print/cancel volume (num of contracts printed and then cancelled)',
`bidCount` SMALLINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'number of bid prints',
`askCount` SMALLINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'number of ask prints',
`bidVolume` INT NOT NULL DEFAULT 0 COMMENT 'bid print volume in contracts',
`askVolume` INT NOT NULL DEFAULT 0 COMMENT 'ask print volume in contracts',
`ebid` FLOAT NOT NULL DEFAULT 0 COMMENT 'exchange bid (@ print time)',
`eask` FLOAT NOT NULL DEFAULT 0 COMMENT 'exchange ask (@ print time)',
`ebsz` INT NOT NULL DEFAULT 0 COMMENT 'exchange bid size',
`easz` INT NOT NULL DEFAULT 0 COMMENT 'exchange ask size',
`eage` FLOAT NOT NULL DEFAULT 0 COMMENT 'age of prevailing quote at time of print',
`prtSide` ENUM('None','Mid','Bid','Ask') NOT NULL DEFAULT 'None',
`prtTimestamp` BIGINT NOT NULL DEFAULT 0 COMMENT 'exchange high precision timestamp (if available)',
`netTimestamp` BIGINT NOT NULL DEFAULT 0 COMMENT 'inbound packet PTP timestamp from SR gateway switch; usually syncronized with facility grandfather clock',
`timestamp` DATETIME(6) NOT NULL DEFAULT '1900-01-01 00:00:00.000000',
`oBid` FLOAT NOT NULL DEFAULT 0 COMMENT 'Option NBBO bid a the time the print was received',
`oAsk` FLOAT NOT NULL DEFAULT 0 COMMENT 'Option NBBO ask a the time the print was received',
`oBidSz` INT NOT NULL DEFAULT 0 COMMENT 'Option NBBO cumulative bid size at the time the print was received',
`oAskSz` INT NOT NULL DEFAULT 0 COMMENT 'Option NBBO cumulative ask size at the time the print was received',
`oBidEx` ENUM('None','AMEX','BOX','CBOE','ISE','NYSE','PHLX','NSDQ','BATS','C2','NQBX','MIAX','GMNI','CME','CBOT','NYMEX','COMEX','ICE','EDGO','MCRY','MPRL','SDRK','DQTE','EMLD','CFE','MEMX','SPHR','EUREX','CEDX','NXAM','NXBR','NXLS','NXML','NXOS','NXP','ICEFE') NOT NULL DEFAULT 'None' COMMENT 'First (or largest) option exchange on the bid',
`oAskEx` ENUM('None','AMEX','BOX','CBOE','ISE','NYSE','PHLX','NSDQ','BATS','C2','NQBX','MIAX','GMNI','CME','CBOT','NYMEX','COMEX','ICE','EDGO','MCRY','MPRL','SDRK','DQTE','EMLD','CFE','MEMX','SPHR','EUREX','CEDX','NXAM','NXBR','NXLS','NXML','NXOS','NXP','ICEFE') NOT NULL DEFAULT 'None' COMMENT 'First (or largest) option exchange on the ask',
`oBidExSz` INT NOT NULL DEFAULT 0 COMMENT 'Option bid size of the largest exchange on the bid at the time the print was received',
`oAskExSz` INT NOT NULL DEFAULT 0 COMMENT 'Option ask size of the largest exchange on the ask at the time the print was received',
`oBidCnt` TINYINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'Number of exchanges on the NBBO bid',
`oAskCnt` TINYINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'Number of exchanges on the NBBO ask',
`oBid2` FLOAT NOT NULL DEFAULT 0 COMMENT 'Second level bid price',
`oAsk2` FLOAT NOT NULL DEFAULT 0 COMMENT 'Second level ask price',
`oBidSz2` INT NOT NULL DEFAULT 0 COMMENT 'Cumulative size on the second level bid price',
`oAskSz2` INT NOT NULL DEFAULT 0 COMMENT 'Cumulative size on the second level ask price',
`oBidIv` DOUBLE NOT NULL DEFAULT 0 COMMENT 'option bid IV',
`oAskIv` DOUBLE NOT NULL DEFAULT 0 COMMENT 'option ask IV',
`uBid` DOUBLE NOT NULL DEFAULT 0 COMMENT 'underlier bid',
`uAsk` DOUBLE NOT NULL DEFAULT 0 COMMENT 'underlier ask',
`uPrc` DOUBLE NOT NULL DEFAULT 0 COMMENT 'underlier price',
`yrs` FLOAT NOT NULL DEFAULT 0 COMMENT 'years to expiry',
`rate` FLOAT NOT NULL DEFAULT 0 COMMENT 'interest rate',
`sdiv` FLOAT NOT NULL DEFAULT 0 COMMENT 'continuous stock dividend',
`ddiv` FLOAT NOT NULL DEFAULT 0 COMMENT 'discrete stock dividend value (sum of dividends <= expiration)',
`xDe` FLOAT NOT NULL DEFAULT 0 COMMENT 'xDelta',
`xAxis` FLOAT NOT NULL DEFAULT 0 COMMENT 'SR surface xAxis value',
`multihedge` ENUM('None','Simple','Complex','AllCash','Binary','Fragment') NOT NULL DEFAULT 'None' COMMENT 'Distinguishes options that have a single underlying security from those that are more complex: multiple securities,cash components, binary options,etc: ''None'',''Simple'',''Complex'',''AllCash'',''Binary''',
`flexType` ENUM('None','AM_Amer','AM_Euro','PM_Amer','PM_Euro','Asian','Cliquet','Other') NOT NULL DEFAULT 'None',
`flexRoot` VARCHAR(12) NOT NULL DEFAULT '',
`prtIv` FLOAT NOT NULL DEFAULT 0 COMMENT 'print implied vol',
`prtDe` FLOAT NOT NULL DEFAULT 0 COMMENT 'print delta',
`prtGa` FLOAT NOT NULL DEFAULT 0 COMMENT 'print gamma',
`prtTh` FLOAT NOT NULL DEFAULT 0 COMMENT 'print theta',
`prtVe` FLOAT NOT NULL DEFAULT 0 COMMENT 'print vega',
`prtRo` FLOAT NOT NULL DEFAULT 0 COMMENT 'print rho',
`calcErr` VARCHAR(24) NOT NULL DEFAULT '' COMMENT 'calc error flag',
`surfVol` FLOAT NOT NULL DEFAULT 0 COMMENT 'SR surface volatility',
`surfOpx` FLOAT NOT NULL DEFAULT 0 COMMENT 'SR surface price',
`surfAtm` FLOAT NOT NULL DEFAULT 0 COMMENT 'SR surface ATM vol',
`prtProbability` FLOAT NOT NULL DEFAULT 0 COMMENT '[M1] probability that buying prtSize contracts @ prtPrice will have positive m10 pnl (prtPriceM10 >= prtPrice) [recorded at time of print]',
`prtProbabilityM2` FLOAT NOT NULL DEFAULT 0 COMMENT 'alternate probability model',
`prtProbabilityM3` FLOAT NOT NULL DEFAULT 0 COMMENT 'alternate probability model',
`oBidM1` FLOAT NOT NULL DEFAULT 0 COMMENT 'NBBO option bid 1 minute after print was received',
`oAskM1` FLOAT NOT NULL DEFAULT 0 COMMENT 'NBBO option ask 1 minute after print was received',
`uBidM1` DOUBLE NOT NULL DEFAULT 0 COMMENT 'NBBO underlying bid 1 minute after print was received',
`uAskM1` DOUBLE NOT NULL DEFAULT 0 COMMENT 'NBBO underlying ask 1 minute after print was received',
`uPrcM1` DOUBLE NOT NULL DEFAULT 0 COMMENT 'Underlying price 1 minute after print was received',
`sVolM1` FLOAT NOT NULL DEFAULT 0 COMMENT 'Suface volatility 1 minute after print was received',
`sOpxM1` FLOAT NOT NULL DEFAULT 0 COMMENT 'Surface option price 1 minute after print was received',
`sDivM1` FLOAT NOT NULL DEFAULT 0 COMMENT 'sDiv 1 minute after print was received',
`sErrM1` VARCHAR(12) NOT NULL DEFAULT '' COMMENT 'Surface error condition (if any) 1 minute after print was received',
`pnlM1` FLOAT NOT NULL DEFAULT 0 COMMENT 'pnl after 1 minute',
`pnlM1Err` ENUM('None','Yes','No') NOT NULL DEFAULT 'None' COMMENT 'Error condition for PnL calculated over the first 1 minute after the print was received',
`oBidM10` FLOAT NOT NULL DEFAULT 0 COMMENT 'NBBO option bid 10 minutes after print was received',
`oAskM10` FLOAT NOT NULL DEFAULT 0 COMMENT 'NBBO option ask 10 minutes after print was received',
`uBidM10` DOUBLE NOT NULL DEFAULT 0 COMMENT 'NBBO underlying bid 10 minutes after print was received',
`uAskM10` DOUBLE NOT NULL DEFAULT 0 COMMENT 'NBBO underlying ask 10 minutes after print was received',
`uPrcM10` DOUBLE NOT NULL DEFAULT 0 COMMENT 'Underlying price 10 minutes after print was received',
`sVolM10` FLOAT NOT NULL DEFAULT 0 COMMENT 'Suface volatility 10 minutes after print was received',
`sOpxM10` FLOAT NOT NULL DEFAULT 0 COMMENT 'Surface option price 10 minutes after print was received',
`sDivM10` FLOAT NOT NULL DEFAULT 0 COMMENT 'sDiv 10 minutes after print was received',
`sErrM10` VARCHAR(12) NOT NULL DEFAULT '' COMMENT 'Surface error condition (if any) 10 minutes after print was received',
`pnlM10` FLOAT NOT NULL DEFAULT 0 COMMENT 'pnl after 10 minutes',
`pnlM10Err` ENUM('None','Yes','No') NOT NULL DEFAULT 'None' COMMENT 'Error condition for PnL calculated 10 minutes after the print was received',
`oBidS1` FLOAT NOT NULL DEFAULT 0 COMMENT 'NBBO option bid 1 second after print was received',
`oAskS1` FLOAT NOT NULL DEFAULT 0 COMMENT 'NBBO option ask 1 second after print was received',
`uBidS1` DOUBLE NOT NULL DEFAULT 0 COMMENT 'NBBO underlying bid 1 second after print was received',
`uAskS1` DOUBLE NOT NULL DEFAULT 0 COMMENT 'NBBO underlying ask 1 second after print was received',
`uPrcS1` DOUBLE NOT NULL DEFAULT 0 COMMENT 'Underlying price 1 second after print was received',
`sVolS1` FLOAT NOT NULL DEFAULT 0 COMMENT 'Suface volatility 1 second after print was received',
`sOpxS1` FLOAT NOT NULL DEFAULT 0 COMMENT 'Surface option price 1 second after print was received',
`sDivS1` FLOAT NOT NULL DEFAULT 0 COMMENT 'sDiv 1 second after print was received',
`sErrS1` VARCHAR(12) NOT NULL DEFAULT '' COMMENT 'Surface error condition (if any) 1 second after print was received',
`pnlS1` FLOAT NOT NULL DEFAULT 0 COMMENT 'pnl after 1 second',
`pnlS1Err` ENUM('None','Yes','No') NOT NULL DEFAULT 'None' COMMENT 'Error condition for PnL calculated over the first 1 second after the print was received',
`oBidNext` FLOAT NOT NULL DEFAULT 0 COMMENT 'next NBBO option bid after print was received',
`oAskNext` FLOAT NOT NULL DEFAULT 0 COMMENT 'next NBBO option ask after print was received',
PRIMARY KEY USING HASH (`okey_tk`,`okey_yr`,`okey_mn`,`okey_dy`,`okey_xx`,`okey_cp`,`okey_at`,`okey_ts`,`prtNumber`)
) ENGINE=SRSE DEFAULT CHARSET=LATIN1 COMMENT='OptionPrintSet records contain every option print along with quote, surface, and SR probability details at print time. These records also contain T+1M and T+10M forward mark details. These records are created for every print at the time of print and are published to the SpiderRock elastic cluster 10 minutes later when T + 10M forward marks are available.';